package com.qianbei.user.applymaster;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;

import com.qianbei.R;

public class ShowImage extends FrameLayout implements
		android.view.View.OnClickListener {

	public ShowImage(Context context) {
		super(context);
	}

	public ImageView show_imge, delet_imge;
	public String id;// 上传的id

	public int ids; // 图片标识0 1 2 3
	
	public String file;

	public ShowImage(Context context, AttributeSet attrs) {
		super(context, attrs);
		View rootLayer = View.inflate(context, R.layout.camera_up, null);
		show_imge = (ImageView) rootLayer.findViewById(R.id.show_imge);
		delet_imge = (ImageView) rootLayer.findViewById(R.id.delet_imge);
		delet_imge.setOnClickListener(this);
		this.addView(rootLayer);
	}

	@Override
	public void onClick(View arg0) {
		switch (arg0.getId()) {
		case R.id.delet_imge:
			show_imge.setImageResource(R.drawable.icon_upload_default);
			if (click != null) {
				click.deletImage(ids);
			}
			break;

		default:
			break;
		}
	}

	public ImageClick click;

	public interface ImageClick {
		void deletImage(int id);
	}



}
